#pragma once
#include <Windows.h>

class CAutoLocker
{
public:
	CAutoLocker(CRITICAL_SECTION* pSection)
	{
		EnterCriticalSection(pSection);
		m_pCriticalSection = pSection;
	}

	~CAutoLocker()
	{
		LeaveCriticalSection(m_pCriticalSection);
	}

private:
	CRITICAL_SECTION*	m_pCriticalSection;
};
